package me.xplabs.scene 
{
	import com.greensock.events.LoaderEvent;
	import flash.display.Bitmap;
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import me.xplabs.Globals;
	import me.xplabs.constant.ResType;
	import me.xplabs.constant.SceneType;
	import me.xplabs.interfaces.IScene;
	import me.xplabs.msg.NotificationName;
	import me.xplabs.utils.Utils;
	import me.xplabs.view.SelecteRaidView;
	import org.puremvc.as3.patterns.mediator.Mediator;
	
	/**
	 * ...
	 * @author xiaohan
	 */
	public class SelectSceneMediator extends Mediator implements IScene
	{
		public static const NAME:String = "SelectSceneMediator";
		private var _container:Sprite;
		private var _isInit:Boolean;
		
		private var _selecteRaidView:SelecteRaidView;
		public function SelectSceneMediator( viewComponent:Object=null) 
		{
			super(NAME, viewComponent);
		}
		private function init():void 
		{
			if (_isInit) return;
			_container = new Sprite();
			
			_selecteRaidView = new SelecteRaidView(_container);
			_selecteRaidView.show();
			
		}
		public function show():void 
		{
			init();
			print("显示关卡选择视图");
			DisplayObjectContainer(viewComponent).addChild(_container);
			
			//sendNotification(NotificationName.SELECTED_RAID, 6001);
		}
		public function dispose():void 
		{
			print("销毁关卡选择视图");
			if (DisplayObjectContainer(viewComponent).contains(_container)) 
				DisplayObjectContainer(viewComponent).removeChild(_container);
		}
		
		public function get container():Sprite 
		{
			return _container;
		}
	}

}